#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>

using namespace std;
string a[1000];
int n;
int main()
{
    freopen("letter.in","r",stdin);
     freopen("letter.out","w",stdout);
	 cin>>n;
	 for(int i=0;i<n;i++)cin>>a[i];
	 sort(a,a+n);
	 for(int i=0;i<n;i++)
	 cout<<a[i]<<endl;
	 fclose(stdin);
	 fclose(stdout);
}
